@extends('default.mobile.layouts.personalPublic')
@section('title','编辑简历-'.Site::get('webname'))
{{--首页css--}}
@section('headcss')
    @parent
    <link rel="stylesheet" href="{{asset('/default/css/mobile/personal/resume_manage.css')}}">
    <link rel="stylesheet" type="text/css" href="{{asset('/vendor/webuploader/dist/webuploader_img.css')}}">
@endsection

{{--头部标签--}}
@section('tag','编辑简历')
@section('link') href="{{url('mobile/personal/my_resume')}}" @endsection

{{--主体内容--}}
@section('content')
        <!-- E 头部 -->
<div class="main" id="main">
    {{--头部信息--}}
    <div class="resumeHead">
        <strong>{{str_limit($resume->resume_name,16)}}</strong>
        <span class="rename">
            <a href="{{url('mobile/personal/rename?resume_id='.$resume->id)}}">[重命名]</a>
        </span>
        <span class="completion">完整度：
            @if($percentage >= 80)
                <em class="percent2">{{$percentage}}%</em></span>
        @else
            <em class="percent1">{{$percentage}}%</em></span>
        @endif
        <div class="headBg"></div>
    </div>
    {{--基本信息--}}
    <div class="mainCon basic">
        <div class="mainTit">
            <h2>基本信息</h2>
            <a href="{{url('mobile/personal/edit_basic?resume_id='.$resume->id)}}"><span class="edit">编辑</span><i
                        class="icon_edit"></i></a>
        </div>
        <div class="mainInfo">
            <div class="basicInfo">
                <div class="avatar" id="avatar"><img src="{{$resume->avatar}}" alt=""></div>
                <dl>
                    <dt>{{$resume->name or ''}}</dt>
                    <dd><span>{{$resume->sex}}</span><b>|</b><span>{{$resume->age}}
                            岁</span><b>|</b><span>{{$resume->marital}}</span></dd>
                </dl>
            </div>
            <div class="listInfo">
                <dl>
                    <dt>最高学历</dt>
                    <dd>{{$resume->education}}</dd>
                </dl>
                <dl>
                    <dt>工作经验</dt>
                    <dd>{{$resume->work_year}}</dd>
                </dl>
                <dl>
                    <dt>求职状态</dt>
                    <dd>{{$resume->job_status}}</dd>
                </dl>
                <dl>
                    <dt>现居地</dt>
                    <dd>{{str_limit($resume->homeaddress,30)}}</dd>
                </dl>
                <dl>
                    <dt>手机号码</dt>
                    <dd>{{$resume->mobile}}</dd>
                </dl>
                <dl>
                    <dt>邮箱地址</dt>
                    <dd>{{$resume->email}}</dd>
                </dl>
                <dl>
                    <dt>户籍地址</dt>
                    <dd>{{str_limit($resume->census,30)}}</dd>
                </dl>
                <dl>
                    <dt>身高</dt>
                    <dd>{{$resume->height}}</dd>
                </dl>
            </div>
        </div>
    </div>
    {{--求职意向--}}
    <div class="mainCon objective">
        <div class="mainTit">
            <h2>求职意向</h2>
            <a href="{{url('mobile/personal/edit_objective?resume_id='.$resume->id)}}"><span class="edit">编辑</span><i
                        class="icon_edit"></i></a>
        </div>
        <div class="mainInfo">
            <div class="listInfo">
                <dl>
                    <dt>意向岗位</dt>
                    <dd>{{str_limit($resume->intentionjobs,30)}}</dd>
                </dl>
                <dl>
                    <dt>工作地区</dt>
                    <dd>{{str_limit($resume->jobarea,30)}}</dd>
                </dl>
                <dl>
                    <dt>期望职位</dt>
                    <dd>{{str_limit($resume->jobsort,30)}}</dd>
                </dl>
                <dl>
                    <dt>期望薪资</dt>
                    <dd>{{$resume->expectedsalary}}</dd>
                </dl>
            </div>
        </div>
    </div>
    {{--自我评价--}}
    <div class="mainCon selfEvaluation">
        <div class="mainTit">
            <h2>自我评价</h2>
            <a href="{{url('mobile/personal/edit_evaluation?resume_id='.$resume->id)}}"><span class="edit">编辑</span><i
                        class="icon_edit"></i></a>
        </div>
        <div class="mainInfo">
            <div class="listInfo"><p>{{$resume->introduction}}</p></div>
        </div>
    </div>
    {{--工作经历--}}
    <div class="mainCon worker">
        <div class="mainTit">
            <h2>工作经历</h2>
            <a href="{{url('mobile/personal/add_work_exp?resume_id='.$resume->id)}}"><span class="edit">添加</span><i
                        class="icon_add"></i></a>
        </div>
        @if(count($workExp) > 0)
            <div class="mainInfo">
                @foreach($workExp as $v)
                    <div class="listCon" id="listCon">
                        <ul>
                            <li><strong>{{str_limit($v->post,14)}}</strong><b>|</b>
                                <span class="school">{{str_limit($v->company,22)}}</span>
                                <em class="del" data-id="{{$v->id}}"></em>
                                <em class="edit"><a
                                            href="{{url('mobile/personal/edit_work_exp/'.$v->id.'?resume_id='.$resume->id)}}"></a></em>
                            </li>
                            <li><span>{{$v->starttime}}</span><span>~</span><span>{{$v->endtime}}</span><b>|</b>
                                <span>{{str_limit($v->industry,22)}}</span>
                            </li>
                            <li class="description">
                                <p>{{$v->content}}</p>
                            </li>
                        </ul>
                    </div>
                @endforeach
            </div>
        @endif
    </div>
    {{--教育经历--}}
    <div class="mainCon education">
        <div class="mainTit">
            <h2>教育经历</h2>
            <a href="{{url('mobile/personal/add_edu_exp?resume_id='.$resume->id)}}"><span class="edit">添加</span><i
                        class="icon_add"></i></a>
        </div>
        @if(count($eduExp) > 0)
            <div class="mainInfo">
                @foreach($eduExp as $v)
                    <div class="listCon">
                        <ul>
                            <li><strong>{{$v->education}}</strong><b>|</b>
                                <span class="school">{{str_limit($v->school,28)}}</span>
                                <em class="del" data-id="{{$v->id}}"></em>
                                <em class="edit"><a
                                            href="{{url('mobile/personal/edit_edu_exp/'.$v->id.'?resume_id='.$resume->id)}}"></a></em>
                            </li>
                            <li><span>{{$v->starttime}}</span><span>~</span><span>{{$v->endtime}}</span><b>|</b>
                                <span>{{str_limit($v->speciality,24)}}</span>
                            </li>
                            <li class="description">
                                <p>{{$v->description}}</p>
                            </li>
                        </ul>
                    </div>
                @endforeach
            </div>
        @endif
    </div>
    {{--培训经历--}}
    <div class="mainCon train">
        <div class="mainTit">
            <h2>培训经历</h2>
            <a href="{{url('mobile/personal/add_train_exp?resume_id='.$resume->id)}}"><span class="edit">添加</span><i
                        class="icon_add"></i></a>
        </div>
        @if(count($trainExp) > 0)
            <div class="mainInfo">
                @foreach($trainExp as $v)
                    <div class="listCon">
                        <ul>
                            <li><strong>{{str_limit($v->speciality,12)}}</strong><b>|</b>
                                <span class="school">{{str_limit($v->school,20)}}</span>
                                <em class="del" data-id="{{$v->id}}"></em>
                                <em class="edit"><a
                                            href="{{url('mobile/personal/edit_train_exp/'.$v->id.'?resume_id='.$resume->id)}}"></a></em>
                            </li>
                            <li><span>{{$v->starttime}}</span><span>~</span><span>{{$v->endtime}}</span></li>
                            <li class="description">
                                <p>{{$v->description}}</p>
                            </li>
                        </ul>
                    </div>
                @endforeach
            </div>
        @endif
    </div>
    {{--项目经验--}}
    <div class="mainCon project">
        <div class="mainTit">
            <h2>项目经验</h2>
            <a href="{{url('mobile/personal/add_project_exp?resume_id='.$resume->id)}}"><span class="edit">添加</span><i
                        class="icon_add"></i></a>
        </div>
        @if(count($projectExp) > 0)
            <div class="mainInfo">
                @foreach($projectExp as $v)
                    <div class="listCon">
                        <ul>
                            <li><strong>{{str_limit($v->project_name,12)}}</strong><b>|</b>
                                <span class="school">担任职位：{{str_limit($v->post,12)}}</span>
                                <em class="del" data-id="{{$v->id}}"></em>
                                <em class="edit"><a
                                            href="{{url('mobile/personal/edit_project_exp/'.$v->id.'?resume_id='.$resume->id)}}"></a></em>
                            </li>
                            <li><span>{{$v->starttime}}</span><span>~</span><span>{{$v->endtime}}</span></li>
                            <li class="description">
                                <p>{{$v->content}}</p>
                            </li>
                        </ul>
                    </div>
                @endforeach
            </div>
        @endif
    </div>
    {{--语言能力--}}
    <div class="mainCon language">
        <div class="mainTit">
            <h2>语言能力</h2>
            <a href="{{url('mobile/personal/add_language?resume_id='.$resume->id)}}"><span class="edit">添加</span><i
                        class="icon_add"></i></a>
        </div>
        @if(count($language) > 0)
            <div class="mainInfo">
                @foreach($language as $v)
                    <div class="listCon">
                        <ul>
                            <li><strong>{{$v->language}}</strong><b>|</b>
                                <span class="school">{{$v->degree}}</span>
                                <em class="del" data-id="{{$v->id}}"></em>
                                <em class="edit"><a
                                            href="{{url('mobile/personal/edit_language/'.$v->id.'?resume_id='.$resume->id)}}"></a></em>
                            </li>
                        </ul>
                    </div>
                @endforeach
            </div>
        @endif
    </div>
    {{--技能专长--}}
    <div class="mainCon skill">
        <div class="mainTit">
            <h2>技能专长</h2>
            <a href="{{url('mobile/personal/add_skill?resume_id='.$resume->id)}}"><span class="edit">添加</span><i
                        class="icon_add"></i></a>
        </div>
        @if(count($skill) > 0)
            <div class="mainInfo">
                @foreach($skill as $v)
                    <div class="listCon">
                        <ul>
                            <li><strong>{{str_limit($v->skillname,20)}}</strong><b>|</b>
                                <span class="school">{{$v->degree}}</span>
                                <em class="del" data-id="{{$v->id}}"></em>
                                <em class="edit"><a
                                            href="{{url('mobile/personal/edit_skill/'.$v->id.'?resume_id='.$resume->id)}}"></a></em>
                            </li>
                        </ul>
                    </div>
                @endforeach
            </div>
        @endif
    </div>
    {{--证书--}}
    <div class="mainCon certificate">
        <div class="mainTit">
            <h2>证书</h2>
            <a href="{{url('mobile/personal/add_certificate?resume_id='.$resume->id)}}"><span class="edit">添加</span><i
                        class="icon_add"></i></a>
        </div>
        @if(count($certificate) > 0)
            <div class="mainInfo">
                @foreach($certificate as $v)
                    <div class="listCon">
                        <ul>
                            <li><strong>{{str_limit($v->certificate_name,20)}}</strong><b>|</b>
                                <span class="school">{{$v->gettime}}年获得</span>
                                <em class="del" data-id="{{$v->id}}"></em>
                                <em class="edit"><a
                                            href="{{url('mobile/personal/edit_certificate/'.$v->id.'?resume_id='.$resume->id)}}"></a></em>
                            </li>
                        </ul>
                    </div>
                @endforeach
            </div>
        @endif
    </div>
    {{--其它信息--}}
    <div class="mainCon other">
        <div class="mainTit">
            <h2>其它信息</h2>
            <a href="{{url('mobile/personal/add_other?resume_id='.$resume->id)}}"><span class="edit">添加</span><i
                        class="icon_add"></i></a>
        </div>
        @if(count($otherArr) > 0)
            <div class="mainInfo">
                @foreach($otherArr as $v)
                    <div class="listCon">
                        <ul>
                            <li><strong>{{str_limit($v->title,28)}}</strong>
                                <em class="del" data-id="{{$v->id}}"></em>
                                <em class="edit"><a
                                            href="{{url('mobile/personal/edit_other/'.$v->id.'?resume_id='.$resume->id)}}"></a></em>
                            </li>
                            <li class="description">
                                <p>{{$v->content}}</p>
                            </li>
                        </ul>
                    </div>
                @endforeach
            </div>
        @endif
    </div>
    {{--我的作品--}}
    <div class="mainCon works">
        <div class="mainTit">
            <h2>我的作品</h2>
        </div>
        @if(count($works) > 0)
            <div class="mainInfo">
                @foreach($works as $v)
                    <div class="listCon creation">
                        <div class="pic"><img src="{{$v->imgurl}}" alt=""></div>
                        <ul>
                            <li><strong>{{str_limit($v->works_name,24)}}</strong>
                                <em class="del" data-id="{{$v->id}}"></em>
                            </li>
                            <li class="description">
                                <p>{{str_limit($v->description,30)}}</p>
                            </li>
                        </ul>
                    </div>
                @endforeach
            </div>
        @endif
    </div>
    {{--预览简历--}}
    <div class="preview"><a href="{{url('mobile/resume_'.idEncryption($resume->id).'.html')}}">预览简历</a></div>
    @endsection

    @section('footerjs')
        @parent
        <script type="text/javascript"
                src="{{asset('/vendor/webuploader/dist/webuploader.html5only.min.js')}}"></script>
        <script type="text/javascript" src="{{asset('/default/js/mobile/personal/upavatar.js')}}"></script>
        <script type="text/javascript" src="{{asset('/default/js/mobile/jquery/zepto.scroll.js')}}"></script>
        <script type="text/javascript">
            var curr_resume_id = '{{$resume->id}}';
            var mainCon = $('#main'); //主体对象
            var _token = "{{csrf_token()}}";
            uploadAvatar('#avatar');
            //参数
            var parameter = '{{$parameter}}';
            $(function(){
                switch(parameter){
                    case 'objective' :
                        $('html,body').scrollTo({scrollTop: mainCon.find('.objective').offset().top});
                        break;
                    case 'selfEvaluation' :
                        $('html,body').scrollTo({scrollTop: mainCon.find('.selfEvaluation').offset().top});
                        break;
                    case 'worker' :
                        $('html,body').scrollTo({scrollTop: mainCon.find('.worker').offset().top});
                        break;
                    case 'education' :
                        $('html,body').scrollTo({scrollTop: mainCon.find('.education').offset().top});
                        break;
                    case 'train' :
                        $('html,body').scrollTo({scrollTop: mainCon.find('.train').offset().top});
                        break;
                    case 'project' :
                        $('html,body').scrollTo({scrollTop: mainCon.find('.project').offset().top});
                        break;
                    case 'language' :
                        $('html,body').scrollTo({scrollTop: mainCon.find('.language').offset().top});
                        break;
                    case 'skill' :
                        $('html,body').scrollTo({scrollTop: mainCon.find('.skill').offset().top});
                        break;
                    case 'certificate' :
                        $('html,body').scrollTo({scrollTop: mainCon.find('.certificate').offset().top});
                        break;
                    case 'other' :
                        $('html,body').scrollTo({scrollTop: mainCon.find('.other').offset().top});
                        break;
                    case 'works' :
                        $('html,body').scrollTo({scrollTop: mainCon.find('.works').offset().top});
                        break;
                }
                //工作经历
                @if(count($workExp) > 0)
                    mainCon.find('.worker').find('.listCon').find('em.del').click(function(){
                    delList($(this).attr('data-id'), '工作经历', '/mobile/personal/del_work_exp', 'worker', curr_resume_id);
                });
                @endif
                //教育经历
                @if(count($eduExp) > 0)
                    mainCon.find('.education').find('.listCon').find('em.del').click(function(){
                    delList($(this).attr('data-id'), '教育经历', '/mobile/personal/del_edu_exp', 'education', curr_resume_id);
                });
                @endif
                //培训经历
                @if(count($trainExp) > 0)
                    mainCon.find('.train').find('.listCon').find('em.del').click(function(){
                    delList($(this).attr('data-id'), '培训经历', '/mobile/personal/del_train_exp', 'train', curr_resume_id);
                });
                @endif
                //项目经验
                @if(count($projectExp) > 0)
                    mainCon.find('.project').find('.listCon').find('em.del').click(function(){
                    delList($(this).attr('data-id'), '项目经验', '/mobile/personal/del_project_exp', 'project', curr_resume_id);
                });
                @endif
                //语言能力
                @if(count($language) > 0)
                    mainCon.find('.language').find('.listCon').find('em.del').click(function(){
                    delList($(this).attr('data-id'), '语言能力', '/mobile/personal/del_language', 'language', curr_resume_id);
                });
                @endif
                //技能专长
                @if(count($skill) > 0)
                    mainCon.find('.skill').find('.listCon').find('em.del').click(function(){
                    delList($(this).attr('data-id'), '技能专长', '/mobile/personal/del_skill', 'skill', curr_resume_id);
                });
                @endif
                //证书
                @if(count($certificate) > 0)
                    mainCon.find('.certificate').find('.listCon').find('em.del').click(function(){
                    delList($(this).attr('data-id'), '证书', '/mobile/personal/del_certificate', 'certificate', curr_resume_id);
                });
                @endif
                //其它信息
                @if(count($otherArr) > 0)
                    mainCon.find('.other').find('.listCon').find('em.del').click(function(){
                    delList($(this).attr('data-id'), '其它信息', '/mobile/personal/del_other', 'other', curr_resume_id);
                });
                @endif
                //我的作品
                @if(count($works) > 0)
                    mainCon.find('.works').find('.listCon').find('em.del').click(function(){
                    delList($(this).attr('data-id'), '我的作品', '/mobile/personal/del_works', 'works', curr_resume_id);
                });
                @endif
            });
        </script>
        <script type="text/javascript" src="{{asset('/default/js/mobile/personal/resume_manage.js')}}"></script>
@endsection